<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common/common::common('修改菜单管理')"/>
    <script th:src="@{/static/assets/backstage/pear/component/pear/pear.js}"></script>
    <script th:src="@{/static/admin/menu/edit.js}" charset="utf-8"></script>
</head>
<body>

<form class="layui-form" id="editMenuInfoForm" th:object="${menuInfo}">
    <div class="layui-form-body">
        <div class="layui-form-item">
            <label for="title" class="layui-form-label">上级目录</label>
            <div class="layui-input-block">
                <input type="text" id="parentTitle" name="parentTitle"
                       th:value="${parentTitle}" autocomplete="off" readonly class="layui-input">
                <button type="button" onclick="editParent()" class="layui-btn fly-input-button">
                    <i class="layui-icon layui-icon-edit"></i>
                    修改上级目录
                </button>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>类型
            </label>
            <div class="layui-input-block" th:with="dicts=${@dict.data('menu_type')}">
                <input type="radio" name="type" th:each="dict : ${dicts}"
                       th:id="${'type_' + dict.value}"
                       th:field="*{type}"
                       th:title="${dict.label}"
                       th:value="${dict.value}"
                       th:checked="${menuInfo.type}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>图标
            </label>
            <div class="layui-input-block">
                <input type="text" id="icon" name="icon" th:field="*{icon}" class="layui-input" lay-filter="iconPicker3">

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>权限编码
            </label>
            <div class="layui-input-block">
                <input type="text" id="code" name="code" th:field="*{code}"
                       autocomplete="off" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>标题
            </label>
            <div class="layui-input-block">
                <input type="text" id="title" name="title" th:field="*{title}"
                       autocomplete="off" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>资源路径
            </label>
            <div class="layui-input-block">
                <input type="text" id="path" name="path" th:field="*{path}"
                       autocomplete="off" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>排序
            </label>
            <div class="layui-input-block">
                <input type="text" id="orderNum" name="orderNum" th:field="*{orderNum}"
                       oninput="value=value.replace(/[^\d]/g,'')" maxlength="3"
                       autocomplete="off" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>打开方式
            </label>
            <div class="layui-input-block" th:with="dicts=${@dict.data('menu_iframe')}">
                <input type="radio" name="iframe" th:each="dict : ${dicts}"
                       th:id="${'iframe_' + dict.value}"
                       th:field="*{visible}"
                       th:title="${dict.label}"
                       th:value="${dict.value}"
                       th:checked="${menuInfo.iframe}">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="required">*</span>是否显示
            </label>
            <div class="layui-input-block" th:with="dicts=${@dict.data('menu_visible')}">
                <input type="radio" name="visible" th:each="dict : ${dicts}"
                       th:id="${'visible_' + dict.value}"
                       th:field="*{visible}"
                       th:title="${dict.label}"
                       th:value="${dict.value}"
                       th:checked="${menuInfo.visible}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                描述
            </label>
            <div class="layui-input-block">
                        <textarea id="remarks" name="remarks" th:field="*{remarks}" maxlength="200"
                                  autocomplete="off" class="layui-textarea"></textarea>
            </div>
        </div>
    </div>

    <div class="form-footer">
        <button type="button" class="button-sub" lay-submit lay-filter="editMenuInfo">保存</button>
        <button type="button" class="button-close" id="buttonClose">关闭</button>
    </div>
    <input type="text" th:value="*{id}" id="id" name="id" style="display: none">
    <input type="text" th:value="*{parentId}" id="parentId" name="parentId" style="display: none">
</form>

</body>
</html>